<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center inteDetails_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub inteDetails_fd0_0'>
					<view class='flex flex-wrap align-center inteDetails_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
						<text class='fu-iconfont2  inteDetails_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='inteDetails_fd0_0_c1_c0'>积分明细</text>
					</view>
					<view class='flex flex-wrap align-center inteDetails_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---tabs导航flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout">
				<view>
					<benben-flex-tabs class-name='inteDetails_benbenTabsfd1_0' v-model="tabs" ref="benben_tabsfd1_0"
						select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false'
						:open-sticky='false' :top='0' :is-show-content='false' :scrollspy='false'
						:tabs-info.sync="tabsInfofd1_0" @change="tabChange()">

						<scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
							class="benben-tabs" style="width:750rpx" :scroll-x="true"
							:scroll-left.sync="tabsInfofd1_0.moveX" scroll-with-animation="all .3s ease">
							<view class="benben-tabs-content" id="benben_tabsfd1_0-content">
								<view id="benben_tabsfd1_0-title" class="benben-tabs-title flex align-center flex ">
									<view
										:class="{ 'checkTitlefd1_0': tabs == '0', 'flex flex-wrap align-center inteDetails_titlefd1_0_c3': true }"
										@tap="tabs = '0'" :id="`benben_tabsfd1_0-title-item-${'0'}`">

										<text class='inteDetails_titleItemfd1_0_c3_c0'>全部</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '1', 'flex flex-wrap align-center inteDetails_titlefd1_0_c4': true }"
										@tap="tabs = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

										<text class='inteDetails_titleItemfd1_0_c3_c0'>收入记录</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '2', 'flex flex-wrap align-center inteDetails_titlefd1_0_c5': true }"
										@tap="tabs = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

										<text class='inteDetails_titleItemfd1_0_c3_c0'>支出记录</text>

									</view>
								</view>
								<view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
									id="benben_tabsfd1_0-line"
									class="benben-tabs-line flex benben-flex-tabs-line inteDetails_linefd1_0"></view>
							</view>
						</scroll-view>

						<view class='flex flex-wrap align-center inteDetails_rightfd1_0_c0'>
							<view class='flex flex-wrap align-center' @tap.stop="popupShow1691659122562=true">
								<image class='inteDetails_rightfd1_0_c0_c0_c0' mode="aspectFill"
									:src='STATIC_URL+"659.png"'></image>
							</view>
						</view>

					</benben-flex-tabs>
				</view>
				<view style="background-color: #f8f8f8;height: 20rpx;width: 100%;"></view>
				<view class="loading_css" v-if="isShow">
					<u-loading size="36" color="#F35D2A"></u-loading>
					<view>加载中</view>
				</view>
				<block v-else>
					<view style="padding: 0 32rpx;">
						<view class='flex flex-direction flex-wrap align-stretch inteDetails_fd1_1'
							v-for='(item,key0) in list' :key='key0'>
							<view class='inteDetails_fd1_1_c0'>
								<view class='flex align-center'>
									<text style="color: #666;">积分：</text>
									<text class='inteDetails_fd1_1_c0_c1_c0' v-if="item.change_score >= 0">+</text>
									<text class='inteDetails_fd1_1_c0_c1_c1'
										v-if="item.change_score >= 0">{{item.change_score}}</text>
									<text class='inteDetails_fd1_1_c0_c1_c1_1' v-else>{{item.change_score}}</text>
								</view>
								<view class='flex align-center justify-between' style="margin-top: 12rpx;">
									<text class='inteDetails_fd1_1_c0_c0_c0'>{{item.title}}</text>
									<text class='inteDetails_fd1_1_c0_c0_c1'>{{item.create_time}}</text>
								</view>
								
							</view>
						</view>
					</view>
					<view class="loadmore">
						<u-loadmore v-if="last_page > 1" font-size="24" :status="status" :icon-type="iconType"
							:load-text="loadText" />
					</view>
				</block>
				<view class="noData" v-if="list.length == 0 && !isShow">
					<image :src='STATIC_URL+"no.png"'></image>
				</view>
			</view>

			<!---tabs导航flex布局结束-->
			<benben-popup v-model="popupShow1691659122562" :mask="true" :mask-close-able="true" mode='center'>
				<!---flex布局flex布局开始-->
				<view class="flex benben-flex-layout flex-wrap align-center">
					<benben-calendar-diy mode='range' year-arrow-color='#BFBFBF' month-arrow-color='#BFBFBF'
						start-text=' ' end-text=' ' active-bg-color='#F35D2A'
						range-bg-color='rgba(238, 214, 210, 1)' :change-title='true' :change-year='true'
						:change-month='true' class='inteDetails_fd2_0' @change="dateChange"
						:start-time.sync="start_time" :end-time.sync="end_time"></benben-calendar-diy>
				</view>
				<!---flex布局flex布局结束-->
			</benben-popup>
		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				"popupShow1691659122562": false,
				"tabsInfofd1_0": {
					lineleft: '',
					lineWidth: '',
					moveX: 0,
					scrollX: 0,
					PageScrollX: 0
				},
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"all": "1",
				"start_time": "",
				"end_time": "",
				"tabs": "0",
				"dataMessage": [],

				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {

				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getList();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			// 积分明细  6551d6403d2d2
			getList() {
				this.$api.post(global.API_VERSION + '6551d6403d2d2', {
					page: this.page,
					status: this.tabs,
					start_time: this.start_time,
					end_time: this.end_time
				}).then(res => {
					// console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 1) {
						this.last_page = res.data.data.last_page;
						if (this.is_pull) {
							this.list = res.data.data.data;
						} else {
							this.list = this.list.concat(res.data.data.data);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			dateChange(e) {
				this.popupShow1691659122562 = false;
				this.start_time = e.start;
				this.end_time = e.end;
				this.page = 1;
				this.is_pull = true;
				this.isShow = true;
				this.getList();
			},
			tabChange(e) {
				this.page = 1;
				this.is_pull = true;
				this.isShow = true;
				this.getList();
			},
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background-size: 100% auto;
		background: #ffffff;
	}

	.inteDetails_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
		background: #ffffff;
	}

	.inteDetails_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.inteDetails_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
	}

	.inteDetails_fd0_0_c0 {
		width: 40rpx;
	}

	.inteDetails_fd0_0 {
		margin: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.inteDetails_fd1_1_c0_c1_c1_1 {
		font-size: 32rpx;
		font-weight: 700;
		color: #333333;
	}

	.inteDetails_fd1_1_c0_c1_c1 {
		font-size: 32rpx;
		font-weight: 700;
		color: #3CC782;
	}

	.inteDetails_fd1_1_c0_c1_c0 {
		font-size: 32rpx;
		font-weight: 700;
		color: #3CC782;
		margin: 0rpx 9rpx 0rpx 8rpx;
	}

	.inteDetails_fd1_1_c0_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
	}

	.inteDetails_fd1_1_c0_c0_c0 {
		font-size: 28rpx;
		font-weight: 500;
		color: #333333;
	}

	.inteDetails_fd1_1_c0 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.inteDetails_fd1_1 {
		background: #FFFFFF;
		background-size: 100% auto !important;
		width: 100%;
		border-bottom: 1rpx solid #eee;
	}

	.inteDetails_titlefd1_0_c5 {
		font-size: 32rpx;
		font-weight: 400;
		color: #ffffff99;
	}

	.inteDetails_titlefd1_0_c4 {
		font-size: 32rpx;
		font-weight: 400;
		color: #ffffff99;
		margin: 0rpx 106rpx 0rpx 0rpx;
	}

	.inteDetails_bodyfd1_0_c3 {
		padding: 24rpx 0rpx 0rpx 0rpx;
	}

	.inteDetails_titleItemfd1_0_c3_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
	}

	.inteDetails_titlefd1_0_c3 {
		font-size: 32rpx;
		font-weight: 400;
		color: #ffffff99;
		margin: 0rpx 106rpx 0rpx 40rpx;
	}

	.inteDetails_linefd1_0 {
		background: #F35D2A;
		width: 40rpx;
		height: 6rpx;
		top: 80rpx;
		background-size: 100% auto !important;
		border-radius: 10rpx 10rpx 10rpx 10rpx;
	}

	.inteDetails_rightfd1_0_c0_c0_c0 {
		width: 32rpx;
		height: 32rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.inteDetails_rightfd1_0_c0 {
		width: 100rpx;
		height: 100%;
	}

	.checkTitlefd1_0 {
		font-weight: 500 !important;
		font-size: 32rpx !important;
		color: #333 !important;
	}

	::v-deep .inteDetails_benbenTabsfd1_0 {
		width: 750rpx;
		height: 94rpx;
		white-space: nowrap;
		text-align: center;
	}

	.inteDetails_fd2_0 {
		background: #ffffff;
		width: 622rpx;
		border-radius: 24rpx;
		padding: 12rpx 012rpx 012rpx 012rpx;
	}
</style>